function HunterG1zStar3()
	if not serpentstingframe then serpentstingframe = CreateFrame("Frame", "serpentstingframe", UIParent) end
	if ccrValidTarget() then
		if _G[UnitGUID("target").."_tSerpentSting"] == nil then _G[UnitGUID("target").."_tSerpentSting"] = 0 end
	end
	if serpentstingframe:IsEventRegistered("COMBAT_LOG_EVENT") ~= 1 then serpentstingframe:RegisterEvent("COMBAT_LOG_EVENT") end
	if serpentstingframe:HasScript("OnEvent") ~= 1 then
		serpentstingframe:SetScript("OnEvent", function(self, event, ...)
			local timestamp, type, _, _, _, _, _, destGUID, destName, _, _, _, spellName, _, _, _ = ...
			if type == "SPELL_AURA_APPLIED" and spellName == "Serpent Sting" then
				_G[destGUID.."_tSerpentSting"] = GetTime()
				return
			end
		end)
	end
	-- if isAoE == nil then AoEToggle() end
	if ccrValidTarget() and ccrPIIC() then
		if isStun and SCA("Intimidation") then
			ccrCastAttack("Intimidation")
			isStun = false
			PrintToChat("Turned off stun automatically")
		end
		-- if ccrTargetCount(10) > 1 and ccRS.Manual_AoE and SIR("Explosive Trap") then
		-- 	ccrCast("Explosive Trap")
		-- 	CastAtLocation(Target:GetLocation())
		-- 	return
		-- end
		if SIR("Fervor") and ccrPlayerFocus() <= 50 then
			ccrCast("Fervor")
			return
		end
		if SCA("A Murder of Crows") then
			ccrCastAttack("A Murder of Crows")
			return
		end
		if SCA("Lynx Rush") then
			ccrCastAttack("Lynx Rush")
			return
		end
		if ccrPHB("Lock and Load") and SCA("Explosive Shot") then
			ccrCastAttack("Explosive Shot")
			return
		end
		if SCA("Glaive Toss") then
			ccrCastAttack("Glaive Toss")
			return
		end
		if SCA("Powershot") then
			ccrCastAttack("Powershot")
			return
		end
		if SCA("Barrage") then
			ccrCastAttack("Barrage")
			return
		end
		if not ccrTargetHasDebuff("Serpent Sting") and SCA("Serpent Sting") and ((GetTime() > _G[UnitGUID("target").."_tSerpentSting"]) or _G[UnitGUID("target").."_tSerpentSting"] == nil) then -- added nil check
			ccrCastAttack("Serpent Sting")
			_G[UnitGUID("target").."_tSerpentSting"] = GetTime()+1.5 -- changed from 3 to 1.5
			return
		end
		if SCA("Explosive Shot") then
			ccrCastAttack("Explosive Shot")
			return
		end
		if SCA("Kill Shot") then
			ccrCastAttack("Kill Shot")
			return
		end
		if not ccrTargetHasDebuff("Black Arrow") and SCA("Black Arrow") then
			ccrCastAttack("Black Arrow")
			return
		end
		if ccrTargetCount(8) > 3 and SCA("Multi-Shot") and ccRS.Manual_AoE then
			ccrCastAttack("Multi-Shot")
			return
		end
		if ccrPHB("Thrill of the Hunt") and (ccrTargetHasDebuffRemaining("Serpent Sting", 2) or not ccrTargetHasDebuff("Serpent Sting")) and SCA("Multi-Shot") then
			if GetTime() < _G[UnitGUID("target").."_tSerpentSting"] then return end
			ccrCastAttack("Multi-Shot")
			_G[UnitGUID("target").."_tSerpentSting"] = GetTime()+1.5 -- changed from 3 to 1.5
			return
		end
		if ccrPHB("Thrill of the Hunt") and SCA("Arcane Shot") then
			ccrCastAttack("Arcane Shot")
			return
		end
		if SIR("Rapid Fire") then
			ccrCast("Rapid Fire")
			return
		end
		if SIR("Dire Beast") then
			ccrCast("Dire Beast")
			return
		end
		if useCDS and SCA("Stampede") and ccrTargetIsBoss() and (ccrPHBS(146310, 10) or ccrPHB("Vicious")) then
			ccrCastAttack("Stampede")
			return
		end
		if ccrTargetHasDebuffRemaining("Serpent Sting", 6) and SCA("Cobra Shot") then
			ccrCastAttack("Cobra Shot")
			return
		end
		if ccrPlayerFocus() >= 67 and SCA("Arcane Shot") then
			ccrCastAttack("Arcane Shot")
			return
		end
		if SCA("Cobra Shot") then
			ccrCastAttack("Cobra Shot")
			return
		end
	end
end